package integration.properties.protocol;

import integration.properties.protocol.impl.FileProtocolImpl;
import integration.properties.protocol.impl.FtpProtocolImpl;
import integration.properties.protocol.impl.HttpProtocolImpl;

public class ProtocolFactory {

    public static Protocol createProtocol (String protocol) {
        if ("http".equalsIgnoreCase(protocol)) return new HttpProtocolImpl();
        else if ("ftp".equalsIgnoreCase(protocol)) return new FtpProtocolImpl();
        else if ("file".equalsIgnoreCase(protocol)) return new FileProtocolImpl();
        else throw new IllegalArgumentException("Invalid protocol argument: " + protocol);
    }
}
